********************************************************************************
* descriptive figure
********************************************************************************

use "build/output/main_panel.dta", clear
tsset coin_id date
keep if coin == "USDT"


gen redemptions_share_with_zeros = redemptions_share
replace redemptions_share_with_zeros = 0 if missing(redemptions_share_with_zeros)

gen issuances_share_with_zeros = issuances_share
replace issuances_share_with_zeros = 0 if missing(issuances_share_with_zeros)

format date %tdm-Y

tempfile tf1
tempfile tf2

tsline redemptions_share_with_zeros, subtitle("Percent of Face Value",  orientation(horizontal)  bexpand justification(left)) plotregion(margin(medium)) legend(ring(0) position(4) rows(2) size(vsmall) symysize(1))saving(`tf1'.gph, replace) title("Redemption") xtitle("") ytitle("") xlabel(#7)

tsline issuances_share_with_zeros, subtitle("Percent of Face Value",  orientation(horizontal)  bexpand justification(left)) plotregion(margin(medium)) legend(ring(0) position(4) rows(2) size(vsmall) symysize(1))saving(`tf2'.gph, replace) title("Issuance") xtitle("") ytitle("") xlabel(#7)

gr combine `tf1'.gph `tf2'.gph, ycommon scale(*1.25)
 
gr export "analysis/output_figures/figure_usdt_redemptions_and_issuance.pdf", replace   

